package com.hkd.product_service.api.fallback;

import com.hkd.common.api.ApiResponse;
import com.hkd.common.api.BaseFallBack;
import com.hkd.common.api.BaseFallbackFactory;
import com.hkd.product_service.api.BrandInfoService;
import com.hkd.product_service.api.ProductCategoryService;
import com.hkd.product_service.api.dto.InsertProductCategoryDTO;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author HKD
 * @date 2022/9/17 21:41
 */

@Component
public class ProductCategoryServiceImplFallback extends BaseFallbackFactory<ProductCategoryService> {
    @Override
    public ProductCategoryService create(Throwable throwable) {
        FeignFallback fallback = new FeignFallback();
        fallback.setCause(throwable);
        return fallback;
    }

    public class FeignFallback extends BaseFallBack implements ProductCategoryService {

        @Override
        public ApiResponse insertProductCategory(String curUserId,List<InsertProductCategoryDTO> param) {
            return defaultFallBack();
        }
    }
}
